<?php

namespace common\models\PercentageItem;

use Yii;

/**
 * This is the model class for table "percentage_item".
 *
 * @property string $id
 * @property string $percentage_id
 * @property string $agent_id
 * @property string $manager_id
 * @property string $real_num
 * @property string $upper_num
 * @property string $created_date
 * @property string $created_ym
 * @property string $updated_time
 * @property string $province
 * @property string $city
 * @property string $plug_id
 * @property string $parent_agent
 * @property string $self_real_num
 * @property string $self_upper_num 自己的终端数 针对有下级代理的代理商
 * @property int $agent_status
 * @property int $manager_status
 */
class PercentageItemBase extends \common\models\CommonModel\CommonModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'percentage_item';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['percentage_id', 'agent_id', 'manager_id', 'real_num', 'upper_num', 'plug_id'], 'required'],
            [['percentage_id', 'agent_id', 'manager_id', 'real_num', 'upper_num', 'plug_id', 'parent_agent', 'self_real_num', 'self_upper_num', 'agent_status', 'manager_status'], 'integer'],
            [['created_date', 'updated_time'], 'safe'],
            [['created_ym'], 'string', 'max' => 7],
            [['province', 'city'], 'string', 'max' => 100],
            [['plug_id', 'created_date', 'manager_id', 'agent_id'], 'unique', 'targetAttribute' => ['plug_id', 'created_date', 'manager_id', 'agent_id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'percentage_id' => 'Percentage ID',
            'agent_id' => 'Agent ID',
            'manager_id' => 'Manager ID',
            'real_num' => 'Real Num',
            'upper_num' => 'Upper Num',
            'created_date' => 'Created Date',
            'created_ym' => 'Created Ym',
            'updated_time' => 'Updated Time',
            'province' => 'Province',
            'city' => 'City',
            'plug_id' => 'Plug ID',
            'parent_agent' => 'Parent Agent',
            'self_real_num' => 'Self Real Num',
            'self_upper_num' => 'Self Upper Num',
            'agent_status' => 'Agent Status',
            'manager_status' => 'Manager Status',
        ];
    }
}
